<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<center>
    <form action="">
        <table>
            <tr>
                <td>名称</td>
                <td><input type="text" name="name" id='ss' onblur="fff()"><span id="span"></span></td>
            </tr>
            <tr>
                <td>手机号</td>
                <td><input type="text" name="tel" onblur="shou()"></td>
            </tr>
            <tr>
                <td>邮箱</td>
                <td><input type="text" name="you" onblur="xiang()"></td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" value="提交"></td>
            </tr>
        </table>
    </form>
</center>
</body>
</html>
<script>
    function fff(){
        var name = document.getElementById('ss').value;
        var ming = /^\w{5,16}$/;
        if(ming.test(name)){
            document.getElementById('span').innerHTML="<font color='green'>√</font>"
        }else{
            document.getElementById('span').innerHTML="<font color='red'>用户名错误</font> "
        }
    }




</script>